//
//  KRMessageNoticeDetailVC.m
//  KEREN
//
//  Created by MW on 2023/4/21.
//

#import "KRMessageNoticeDetailVC.h"
#import "KRRepairReportListVC.h"

@interface KRMessageNoticeDetailVC ()

@end

@implementation KRMessageNoticeDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavViewWithRightTitle:@"" navColorIswhite:YES withTitle:@"消息详情"];
    WEAKSELF
//    self.rightClickBlock = ^(void){
//        KRRepairReportListVC *vc = [[KRRepairReportListVC alloc] init];
//        [weakSelf.navigationController pushViewController:vc animated:YES];
//    };
    [self setUIView];
}

- (void)setUIView{
    UIImageView *icon = [[UIImageView alloc] init];
    [self.view addSubview:icon];
    if(_type == 0){
        icon.image = [UIImage imageNamed:@"error_nosel_icon"];
    }else if (_type == 1){
        icon.image = [UIImage imageNamed:@"messge_gj_icon"];
    }else{
        icon.image = [UIImage imageNamed:@"message_notice_icon"];
    }
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(24);
        make.top.offset(100 + STATUSBAR_HEIGHT);
        make.width.height.offset(36);
    }];
    
    UILabel *titleLbl = [UILabel setLblText:_dict[@"title"] font:BFont(20) withColor:Black_Color inSubView:self.view];
    [titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(icon.mas_right).offset(12);
        make.top.offset(92 + STATUSBAR_HEIGHT);
        make.right.offset(-24);
    }];
    
    UILabel *timeLbl = [UILabel setLblText:[[DeteManager shareInstance] timeFormatted:[_dict[@"created_at"] intValue]] font:Font(12) withColor:Color_86898E inSubView:self.view];
    
    [timeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(icon.mas_right).offset(12);
        make.top.equalTo(titleLbl.mas_bottom).offset(4);
    }];
    
    UIView *whiteView = [[UIView alloc] init];
    [self.view addSubview:whiteView];
    whiteView.backgroundColor = Whire_Color;
    UILabel *detailLbl = [UILabel setLblText:_dict[@"content"] font:Font(14) withColor:Black_Color inSubView:whiteView];
    detailLbl.numberOfLines = 0;
    [detailLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.offset(16);
        make.right.offset(-16);
    }];
    [whiteView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(24);
        make.right.offset(-24);
        make.top.equalTo(timeLbl.mas_bottom).offset(20);
        make.bottom.equalTo(detailLbl.mas_bottom).offset(16);
    }];
    whiteView.layer.cornerRadius = 25;
    whiteView.clipsToBounds = YES;
}

@end
